<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>1.v-for</title>
    <!-- 引入Vue -->
    <script type="text/javascript" src="../../js/vue.js"></script>
  </head>
  <body>
    <!-- 准备好一个容器-->
    <div id="demo">
      <ul>
        <li v-for="p in persons" :key="p.id">{{p.name}} - {{p.age}}</li>
        <!-- <li v-for="(p,index) in persons" :key="index">{{p.name}} - {{p.age}}</li> -->
      </ul>
    </div>

    <script type="text/javascript">
      new Vue({
        el:'#demo',
        data:{
          persons:[
            {id:'aiusgdyua1',name:'美丽张琪琪',age:18},
            {id:'aiusgdyua2',name:'圆圆的海峰',age:90},
            {id:'aiusgdyua3',name:'帅气的龙龙',age:30},
            {id:'aiusgdyua4',name:'优雅的老段',age:34}
          ]
        }
      })
    </script>
  </body>
</html>